<!DOCTYPE html>
<script src=../resources/testharness.js></script>
<script src=../resources/testharnessreport.js></script>
<script>

// Checks navigator.mediaCapabilities.encodingInfo() with H264/AVC1  MIME types.

['video/webm;codecs=h264',
 'video/webm;codecs=H264',
 'video/webm;codecs=avc1',
 // 'video/webm' supports audio codec specification, see
 // http://www.webmproject.org/docs/container/
 'video/webm;codecs="h264,opus"',
 'video/webm;codecs="h264,vp9,opus"',
 // https://matroska.org/technical/specs/notes.html#MIME
 'video/x-matroska;codecs=opus']
.forEach(function(mimeType) {
  promise_test(function() {
    const media = mimeType.split('/')[0];
    assert_equals(media, 'video', mimeType + 'supported?');

    const queryParameters = {
        type : 'record',
        video : {
          contentType : mimeType,
          width : 640,
          height : 480,
          bitrate : 10000,
          framerate : 30
        }
      };

    return navigator.mediaCapabilities.encodingInfo(queryParameters)
        .then((result) => {
          assert_true(result.supported, mimeType + 'supported?');
        });
  }, mimeType);
});


</script>

